(Fcall_process): Bind inhibit-modification-hooks to t when decoding
authorEli Zaretskii <eliz@gnu.org>
Mon, 2 Mar 2009 21:03:21 +0000 (21:03 +0000)
committerEli Zaretskii <eliz@gnu.org>
Mon, 2 Mar 2009 21:03:21 +0000 (21:03 +0000)
process output.

src/callproc.c

index 316740391ed2b9e1b3e0eaa0a52edafb477453c1..d55fe695e7699e292e2fb338a522f85a6994716f 100644 (file)
@@ -732,10 +732,18 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS)  */)
            else
              {                 /* We have to decode the input.  */
                Lisp_Object curbuf;
+               int count1 = SPECPDL_INDEX ();
 
                XSETBUFFER (curbuf, current_buffer);
+               /* We cannot allow after-change-functions be run
+                  during decoding, because that might modify the
+                  buffer, while we rely on process_coding.produced to
+                  faithfully reflect inserted text until we
+                  TEMP_SET_PT_BOTH below.  */
+               specbind (Qinhibit_modification_hooks, Qt);
                decode_coding_c_string (&process_coding, buf, nread,
                                        curbuf);
+               unbind_to (count1, Qnil);
                if (display_on_the_fly
                    && CODING_REQUIRE_DETECTION (&saved_coding)
                    && ! CODING_REQUIRE_DETECTION (&process_coding))